package com.zhangdi.demo.solr.config;

import com.mongodb.TransactionOptions;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.MongoTransactionManager;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import org.springframework.data.solr.repository.config.EnableSolrRepositories;

/**
 * Created by zhangdi on 2020/06/30 09:50:42.
 */

@EnableSolrRepositories
@EnableMongoRepositories("com.zhangdi.demo.solr.repository")
@Configuration
public class JPAConfig {
    @Bean
    MongoTransactionManager transactionManager(MongoDatabaseFactory factory) {
        return new MongoTransactionManager(factory);
    }
}
